home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / machserver / 1.098 / Include / trace.h < prev    next >
C/C++ Source or Header  |  1991-06-27  |  3KB  |  82 lines

  1. /*
  2.  * trace.h --
  3.  *
  4.  *    Definitions for the generalized tracing facility.
  5.  *
  6.  * Copyright 1991 Regents of the University of California
  7.  * Permission to use, copy, modify, and distribute this
  8.  * software and its documentation for any purpose and without
  9.  * fee is hereby granted, provided that this copyright
  10.  * notice appears in all copies.  The University of California
  11.  * makes no representations about the suitability of this
  12.  * software for any purpose.  It is provided "as is" without
  13.  * express or implied warranty.
  14.  *
  15.  * $Header: /sprite/src/kernel/utils/RCS/trace.h,v 9.2 91/06/27 12:16:03 shirriff Exp $ SPRITE (Berkeley)
  16.  */
  17.  
  18. #ifndef _TRACE
  19. #define _TRACE
  20.  
  21. #include "spriteTime.h"
  22.  
  23. /*
  24.  * Information applicable to an entire circular buffer.
  25.  */
  26.  
  27. typedef struct Trace_Header {
  28.     int numRecords;        /* the number of records in the buffer */
  29.     int currentRecord;        /* which entry is the next to be written */
  30.     int flags;            /* TRACE_INHIBIT, TRACE_NO_TIMES */
  31.     int dataSize;        /* the size of client-specific trace
  32.                  * information corresponding to each record */
  33.     struct Trace_Record *recordArray;  /* pointer to array of trace records */
  34. } Trace_Header;
  35.  
  36. /*
  37.  * Trace Header Flags:
  38.  *
  39.  *    TRACE_INHIBIT        - Inhibit taking traces, used internally.
  40.  *    TRACE_NO_TIMES        - Don't take time stamps, faster.
  41.  */
  42.  
  43. #define TRACE_INHIBIT        0x01
  44. #define TRACE_NO_TIMES        0x02
  45.  
  46. /*
  47.  * Information stored per-record.
  48.  */
  49.  
  50. typedef struct Trace_Record {
  51.     Time time;            /* time record was last modified */
  52.     int flags;            /* flags used by the Trace module */
  53.     int event;            /* event being traced */
  54.     ClientData *traceData;    /* pointer into corresponding client-specific
  55.                  * record, if it exists */
  56. } Trace_Record;
  57.  
  58. /*
  59.  * Record Flags:
  60.  *
  61.  *    TRACE_DATA_VALID    - All data for this record is valid.
  62.  *    TRACE_UNUSED        - Indicates that a record is not used yet.
  63.  *    TRACE_DATA_INVALID    - The traceData area has been zeroed because
  64.  *                  the caller passed a NIL pointer for data.
  65.  */
  66.  
  67. #define TRACE_DATA_VALID    0x00
  68. #define TRACE_UNUSED         0x01
  69. #define TRACE_DATA_INVALID    0x10
  70.  
  71. extern void        Trace_Init _ARGS_((Trace_Header *traceHdrPtr,
  72.                        int numRecords, int size,
  73.                        int flags));
  74. extern void        Trace_Insert _ARGS_((Trace_Header *traceHdrPtr,
  75.                          int event, ClientData data));
  76. extern ReturnStatus    Trace_Dump _ARGS_((Trace_Header *traceHdrPtr,
  77.                        int numRecs, Address addr));
  78. extern ReturnStatus    Trace_Print _ARGS_((Trace_Header *traceHdrPtr,
  79.                         int numRecs, int (*printProc)()));
  80.  
  81. #endif /* _TRACE */
  82.